forum

home / developersection / forums / php array merge and convert to json

php array merge and convert to json

Manoj Bhatt 3395 02-May-2013
Hi Expert!

I have two arrays (below). Is it possible to convert them into json string?

Array
        (
            [0] => size
            [1] => color
        )
Array
        (
            [0] => L
            [1] => Black
        )
Output structure should be:

[
   {"name":"size","value":"L"},
   {"name":"color","value":"Black"}
]

Thanks!

php php 
Updated on 02-May-2013
Manoj Bhatt

Other


Message
Can you answer this question?

Answer

1 Answers

Liked By